<?php
defined('IN_MAIN') or exit('Invalid Access!');
    
function is_group_matrix_downline_of_which($uid, $upline_id, $which_network){
	global $vars;
	$db=$vars["db"];
	$yes=false;
	if($uid && $upline_id){
		$id=$uid;
		do{
			$ref=@mysql_result(mysql_query("select $which_network from $db->users where id='$id'"), 0);
			if($ref!=$upline_id){
				$id=$ref;
			}else{
				$yes=true;
			}
		}while(!$yes && $id);
	}
	return $yes;
}
?>